package com.flexcloudsdk.files;
import java.util.logging.Logger;

import com.google.appengine.api.files.AppEngineFile.FileSystem;

public class CloudFileSystem  {
	private static final Logger log = Logger.getLogger(CloudFileSystem.class.getName());

	FileSystem filesystem;
	private String sourceClass;
	private String sourceMethod;

	public CloudFileSystem() {
		log.info("CloudFileSystem has been created by BlazeDS");
		sourceMethod = Thread.currentThread().getStackTrace()[1].getMethodName().toString();
		sourceClass = CloudFileSystem.class.getName();
	}

	public 	CloudFileSystem fromName(String name) {
		sourceMethod = Thread.currentThread().getStackTrace()[1].getMethodName().toString();
		log.info("Executing: " + sourceClass + "." + sourceMethod);
		return this;
	}

	public Class<FileSystem> getDeclaringClass() {
		sourceMethod = Thread.currentThread().getStackTrace()[1].getMethodName().toString();
		log.info("Executing: " + sourceClass + "." + sourceMethod);
		return filesystem.getDeclaringClass();
	}
	
	@Override
	public String toString() {
		sourceMethod = Thread.currentThread().getStackTrace()[1].getMethodName().toString();
		log.info("Executing: " + sourceClass + "." + sourceMethod);
		return filesystem.toString();
	}

}
